package a.d;

import a.c.v;
import a.c.y;
import a.c.z;

import java.util.Comparator;

class g
{
  public static z a(z paramz)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    z localz1 = new z(paramz.h());
    z localz2 = new z();
    localz1.k();
    if (!bool2) {
      if (localz1.isEmpty()) {
        return localz2;
      }
    }
    Object localObject = (w)localz1.b();
    localz2.b(localObject);
    do
    {
      do
      {
        if (localz1.isEmpty()) {
          break;
        }
        if (bool1) {
          break label104;
        }
        if (!((w)localObject).equals(localz1.a())) {
          break;
        }
        localz1.b();
      } while (!bool1);
    } while (bool2);
    if (localz1.isEmpty()) {
      label104:
      return localz2;
    }
    localObject = (w)localz1.b();
    v localv1 = localz2.b(localObject);
    y localy = localz1.h();
    if (localy.e()) {}
    label231:
    while (bool2)
    {
      w localw = (w)localy.j();
      if (!bool2)
      {
        if (!localw.equals(localObject)) {
          localObject = localw;
        }
      }
      else
      {
        if ((bool2) || (localz2.size() == 2)) {
          if (!bool2)
          {
            if (k.d((w)localz2.a(), (w)localz2.d(), localw))
            {
              if (bool2) {
                break label231;
              }
              localv1.a(localw);
            }
          }
          else {
            if (!bool1) {
              break label401;
            }
          }
        }
        v localv2 = localv1;
        do
        {
          do
          {
            if (k.c((w)localz2.f(localv2).c(), (w)localv2.c(), localw)) {
              break;
            }
            localv2 = localz2.f(localv2);
            if (bool2) {
              break label410;
            }
            if (bool1) {
              break label408;
            }
          } while (!bool1);
        } while (bool2);
        v localv3 = localv1;
        do
        {
          do
          {
            while (bool2) {
              if (!k.b((w)localz2.e(localv3).c(), (w)localv3.c(), localw))
              {
                if (bool2) {
                  break label399;
                }
                localv3 = localz2.e(localv3);
                if (bool1) {
                  break label386;
                }
                if (!bool1) {
                  break;
                }
              }
            }
            if (localv3 == localz2.e(localv2)) {
              break;
            }
            localz2.h(localz2.e(localv2));
            if (bool2) {
              break label410;
            }
            if (bool1) {
              break label408;
            }
          } while (!bool1);
        } while (bool2);
        localv1 = localz2.b(localw, localv2);
      }
      localy.f();
      if (!bool1) {
        break;
      }
    }
    label386:
    label399:
    label401:
    label408:
    label410:
    return localz2;
  }
  
  static class a_
    implements Comparator
  {
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = w.e;
      w localw1 = (w)paramObject1;
      w localw2 = (w)paramObject2;
      if (!bool) {
        if (localw1.a() < localw2.a()) {
          return -1;
        }
      }
      if (!bool) {
        if (localw1.a() > localw2.a()) {
          return 1;
        }
      }
      if (!bool) {
        if (localw1.b() < localw2.b()) {
          return -1;
        }
      }
      if (!bool) {
        if (localw1.b() > localw2.b()) {
          return 1;
        }
      }
      return 0;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.d.g

 * JD-Core Version:    0.7.0.1

 */